package com.example.everying.config;/*
 * 项目名称: everything
 * 文件名: WebConfig
 * 作者: 张泽阳
 * 日期: 2025/5/28
 * 描述:
 */

import com.example.everying.interceptor.JwtInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfig implements WebMvcConfigurer {
    private final JwtInterceptor jwtInterceptor;

    public WebConfig(JwtInterceptor jwtInterceptor) {
        this.jwtInterceptor = jwtInterceptor;
    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(jwtInterceptor)

                .excludePathPatterns(
                        "/wxlogin/login",
                        "/admin/article/detail/**",
                        "/activity/comment/**/comments"
                );
    }
}
